<template>
    <h2>管理员查看用户投资</h2>
    理财名称
    <input type="text" v-model="state.name" />
    用户名称
    <input type="text" v-model="state.uname" />
    <input type="button" value="查询"  @click="show" >
    <input type="button" value="倒序"  @click="show2" >
    <table class="table table-bordered">
        <tr>
            <td>用户名</td>
            <td>投资名称</td>
            <td>总额度</td>
            <td>已投金额</td>
            <td>剩余额度</td>
            <td>投资日期</td>
        
         
        </tr>
        <tr v-for="item in list">
            <td>{{ item.U_Name }}</td>
            <td>{{ item.I_Name }}</td>
            <td>{{ item.I_Sum }}</td>
            <td>{{ item.I_Money }}</td>
            <td>{{ item.I_All }}</td>
            <td>2024.6.17</td>
        </tr>
    </table>

</template>

<script setup lang="ts">
import {ref, reactive, onMounted,toRefs} from 'vue'
import {useRouter,useRoute} from 'vue-router'
import axios from 'axios';
const router=useRouter();
const route=useRoute();
const data:any=reactive({
    state:{
        name:"", uname:"",iid:route.query.id
    },
    ListCount:'',
    PageCount:'',
    list:[],
    llist:[]
})
let {state,list,ListCount,PageCount,llist} =toRefs(data);
onMounted(()=>{
  show();

})

//8.	管理员-理财列表分页展示
const show=()=>{
    axios({
        url:"/api/Invest/GetAdminrInvest",
        method:'get',
        params:state.value
    })
    .then(res=>{
        console.log(res);
        list.value=res.data.Plist;
    })
}
//（定制化排序 正序倒序
const show2=()=>{
    axios({
        url:"/api/Invest/DGetAdminrInvest",
        method:'get',
        params:state.value
    })
    .then(res=>{
        console.log(res);
        list.value=res.data.Plist;
    })
}


</script>


<style>


</style>